<?php
/**
 * The following variables are available in this template:
 * - $this: the CrudCode object
 */
?>
<?php echo "<?php\n"; ?>
/* @var $this <?php echo $this->getControllerClass(); ?> */
/* @var $model <?php echo $this->getModelClass(); ?> */

<?php
$label=$this->pluralize($this->class2name($this->modelClass));
echo "\$this->breadcrumbs=array(
	'$label'=>array('admin'),
	'Manage',
);\n";
?>
Yii::app()->clientScript->registerScript('search', "
$('#search-form form').submit(function(){
	$('#<?php echo $this->class2id($this->modelClass); ?>-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<div class="row-fluid">
	<div class="span12">
    	<div class="box gradient">
        	<div class="title">
           	<?php echo  "<?php echo CHtml::link(Yii::t('common','Advanced Search'),'#collapseOne',array('class'=>'search-button accordion-toggle collapsed btn btn-mini zyBtn03','data-toggle'=>'collapse','data-parent'=>'#accordion2')); ?>\n" ;?>
             <?php echo "<?php echo CHtml::link(Yii::t('common','Create'), array('create'),array('class'=>'btn btn-small create',));?>";?>
              <h3> <i class="icon-sitemap"></i> <span><?php echo "<?php echo Yii::t('".$this->class2name($this->modelClass)."','Manage ".$this->pluralize($this->class2name($this->modelClass))."') ?>";?></span> </h3>
            </div>
            
			<div class="content"> 
			
 			<!--search start-->
 			
              <?php echo "<?php \$this->renderPartial('_search',array(
					'model'=>\$model,
				)); ?>\n"; ?>
              
            <!--search over-->
            
            <!-- table start -->
            
<?php echo "<?php"; ?> $this->widget('application.extensions.zgrid.ZGridView', array(
	'id'=>'<?php echo $this->class2id($this->modelClass); ?>-grid',
	'dataProvider'=>$model->search(),
	'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pager'=>array('class'=>'CLinkPager','hiddenPageCssClass'=>'','firstPageCssClass'=>'first paginate_button','htmlOptions'=>array('class'=>'dataTables_paginate paging_full_numbers"'),'header'=>""),
	'pagerCssClass'=>'pagination',
	'cssFile'=>false,
	'template'=>'{items}{summary}{pager}',
	'summaryText'=>'Default Pagination',
	//'filter'=>$model,
	
	'columns'=>array(
<?php
$count=0;
foreach($this->tableSchema->columns as $column)
{
	if(++$count==7)
		echo "\t\t/*\n";
	
	echo	"\t\t"."array('name'=>'".$column->name."','headerHtmlOptions'=>array('style'=>'width:10%'))".",\n";
}
if($count>=7)
	echo "\t\t*/\n";
?>
		array(
			'class'=>'CButtonColumn',
			'header' => Yii::t ( 'common', 'Operater' ),
			'template'=>'{view} {update} {delete}',
			'headerHtmlOptions'=>array('style'=>'width:10%'),
	    	'buttons'=>array (
		        'update'=> array(
		            'label'=>'<i class="gicon-edit"></i>',
		            'imageUrl'=>0,
		            'options'=>array( 'class'=>'btn btn-small','rel'=>'tooltip','data-placement'=>'left','title'=>Yii::t('common','Update')),
		        ),
		        'view'=>array(
		            'label'=>'<i class="gicon-eye-open"></i>',
		            'imageUrl'=>0,
		            'options'=>array('class'=>'btn btn-small','rel'=>'tooltip','data-placement'=>'left','title'=>Yii::t('common','View')),
		        ),
		        'delete'=>array(
		            'label'=>'<i class="gicon-remove icon-white"></i>',
		            'imageUrl'=>0,
		             'options'=>array( 'class'=>'btn btn-inverse btn-small','rel'=>'tooltip','data-placement'=>'left','title'=>Yii::t('common','Delete')),
		        ),
		     ),
	    ),
	),
)); ?>
					<!--table over -->
			</div><!--//content-->
		</div><!--//box-->
	</div><!--//span12-->
</div><!--//row-fluid-->
